package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.StockMoveMapper;
import com.sumi.erp.domain.StockMove;
import com.sumi.erp.service.IStockMoveService;

/**
 * 调拨单Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-28
 */
@Service
public class StockMoveServiceImpl implements IStockMoveService 
{
    @Autowired
    private StockMoveMapper stockMoveMapper;

    /**
     * 查询调拨单
     * 
     * @param id 调拨单主键
     * @return 调拨单
     */
    @Override
    public StockMove selectStockMoveById(Long id)
    {
        return stockMoveMapper.selectStockMoveById(id);
    }

    /**
     * 查询调拨单列表
     * 
     * @param stockMove 调拨单
     * @return 调拨单
     */
    @Override
    public List<StockMove> selectStockMoveList(StockMove stockMove)
    {
        return stockMoveMapper.selectStockMoveList(stockMove);
    }

    /**
     * 新增调拨单
     * 
     * @param stockMove 调拨单
     * @return 结果
     */
    @Override
    public int insertStockMove(StockMove stockMove)
    {
        stockMove.setCreateTime(DateUtils.getNowDate());
        return stockMoveMapper.insertStockMove(stockMove);
    }

    /**
     * 修改调拨单
     * 
     * @param stockMove 调拨单
     * @return 结果
     */
    @Override
    public int updateStockMove(StockMove stockMove)
    {
        return stockMoveMapper.updateStockMove(stockMove);
    }

    /**
     * 批量删除调拨单
     * 
     * @param ids 需要删除的调拨单主键
     * @return 结果
     */
    @Override
    public int deleteStockMoveByIds(Long[] ids)
    {
        return stockMoveMapper.deleteStockMoveByIds(ids);
    }

    /**
     * 删除调拨单信息
     * 
     * @param id 调拨单主键
     * @return 结果
     */
    @Override
    public int deleteStockMoveById(Long id)
    {
        return stockMoveMapper.deleteStockMoveById(id);
    }
}
